package com.drakulo.games.ais.core.delayed;

import java.math.BigDecimal;
import java.util.Map;

import com.drakulo.games.ais.core.Colony;
import com.drakulo.games.ais.core.Resource;
import com.drakulo.games.ais.core.building.Building;

/**
 * A special action is initiated by a building in a colony.
 * 
 * @author Drakulo
 * 
 */
public class ColonyAction extends DelayedAction {
	/** The action id */
	private String name;
	/** The cost map */
	private Map<Resource, BigDecimal> costMap;
	/** The graphic key */
	private String gfxKey;
	/** Linked building */
	private Building linkedBuilding;
	/** Title key */
	private String i18nKey;
	/** The colony */
	private Colony colony;

	protected ColonyAction(Colony c, String name,
			Map<Resource, BigDecimal> costMap, int duration, int robotsUsed,
			String gfxKey, String i18nKey) {
		super(duration, robotsUsed);
		this.colony = c;
		this.costMap = costMap;
		this.name = name;
		this.gfxKey = gfxKey;
		this.i18nKey = i18nKey;
	}

	public ColonyAction clone() {
		ColonyAction a = new ColonyAction(this.colony, this.name, this.costMap,
				this.getDuration(), this.getRobotsUsed(), this.gfxKey,
				this.i18nKey);
		a.setCallback(this.getCallback());
		return a;
	}

	public String getName() {
		return this.name;
	}

	public Map<Resource, BigDecimal> getCostMap() {
		return this.costMap;
	}

	public String getGfxKey() {
		return this.gfxKey;
	}

	public Building getLinkedBuilding() {
		return linkedBuilding;
	}

	public void setLinkedBuilding(Building linkedBuilding) {
		this.linkedBuilding = linkedBuilding;
	}

	public String getI18nKey() {
		return this.i18nKey;
	}

	public Colony getColony() {
		return colony;
	}

	public void setColony(Colony colony) {
		this.colony = colony;
	}

}
